﻿#pragma once
#include "Model.h"
#include "Texture.h"
#include "Marco.h"
#include <assimp\cimport.h>
#include <assimp\Importer.hpp>
#include <assimp\scene.h>
#include <assimp\postprocess.h>
#include "Vertex.h"

class Entity
{
protected:
	Model** m_Models;		// List models of Entity
	int m_NumModel;			// Number of Models
	Texture** m_Textures;	// List Textures of Entity
	int m_NumTextures;		// Number of Textures

	Shaders* m_Shader;		// Shader of Entity

	Vector3 m_Position;		// Entity Position
	Vector3 m_Rotate;		// Entity Rotation
	Vector3 m_Scale;		// Entity Scale
public:
	char* Name;				// public Name Entity
	Entity();				
	virtual ~Entity();
	Vector3 getProperties(int index);					// 0:Position - 1:Scale - 2:Rotate
	void setProperties(int index, Vector3 value);		// 0:Position - 1:Scale - 2:Rotate
	
	// Load file 3d:
	void Clear();
	int Load_Collada(const char* filename, char* VS, char* FS);
	bool InitFromScene(const aiScene* pScene, const char* Filename);
	void InitMesh(unsigned int Index, const aiMesh* paiMesh);
	bool InitMaterials(const aiScene* pScene, const std::string& Filename);
	friend string GetName(string file);
	//
	virtual void SetPostion(Vector3);
	virtual void SetScale(Vector3);

	Model** getModels();								// Get array Models
	Model* getModels(int index);						// Get Model at index 
	Texture** getTextures();							// Get array Textures
	Texture* getTextures(int index);					// Get Texture at index
	void setShader(Shaders* sha);
	Shaders* getShader();
	virtual void draw();
	virtual void update(float deltatime) = 0;
};

